package com.situ.mall.design.singleton;

public enum Sex {
    MAIL, FEMALE;
}

/*final class Sex extends Enum<Sex> {
    public static final Sex MALE;
    public static final Sex FEMALE;

    private Sex(String name, int ordinal) {
        super(name, ordinal);
    }

    // 饿汉式单例，类加载时候就构造好
    static {
        // 会放到静态代码块中执行，静态代码块里面的线程安全由虚拟机来保证
        MALE = new Sex("MALE", 0);
        FEMALE = new Sex("FEMALE", 1);
    }
}*/